package com.manage.demo.service;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.manage.demo.dao.StudentMapper;
import com.manage.demo.dao.model.StudentInfo;
import com.manage.demo.dao.model.ClassInfo;
@Service
@Transactional
public class StudentService {
	@Autowired
	private StudentMapper StudentMapper;
	
	public List<StudentInfo> getStudentListByCondition(String session, String grade, String classname, String id, int limit, int offset) {
		return StudentMapper.getStudentListByCondition(session, grade, classname,  id, limit, offset);
	}
	
	public List<Integer> getStudentIdByCondition(Integer id) {
		return StudentMapper.getStudentIdByCondition(id);
	}
	
	public List<Map<String, Object>> getStudentMange(String id) {
		return StudentMapper.getStudentMange(id);
	}

	public Integer setStudentByCondition(String id, String name, String sex, String ingrade, String inclassname, String tele, String idcard) {
		return StudentMapper.setStudentByCondition(id, name, sex, ingrade, inclassname, tele, idcard);
	}
	
	public Integer setUserByCondition(String id) {
		return StudentMapper.setUserByCondition(id);
	}
	
	@Transactional
	public Integer update(String id, String name, String sex, String ingrade, String inclassname, String tele, String idcard) {
		return StudentMapper.updateStudent(id, name, sex, ingrade, inclassname, tele, idcard);
	}
	
	@Transactional
	public Integer delete(String id) {
		return StudentMapper.deleteStudent(id);
	}
	
	@Transactional
	public Integer deleteuser(String id) {
		return StudentMapper.deleteuser(id);
	}
	
	@Transactional
	public List<String> getSession() {
		return StudentMapper.getSession();
	}
	
	public List<String> getGradeList(String grade, String classname) {
		return StudentMapper.getGradeList(grade, classname);
	}
	public List<Map<String, Object>> getCount(String session, String grade, String classname, String id) {
		return StudentMapper.getCount(session, grade, classname,  id);
	}
}
